const nameSpace = "BSStore";
const AppLocalStorage = {
  setItem(key, value) {
    window.localStorage.setItem(`${nameSpace}-${key}`, value);
  },
  getItem(key) {
    return window.localStorage.getItem(`${nameSpace}-${key}`);
  },
  removeItem(key) {
    window.localStorage.removeItem(`${nameSpace}-${key}`);
  },
  clear() {
    window.localStorage.clear();
  },
  storage: {
    token(v) {
      let key = "token";
      if (v == undefined) {
        return AppLocalStorage.getItem(key);
      } else {
        AppLocalStorage.setItem(key, v);
      }
    },
    appid(v) {
      let key = "aid";
      if (v === undefined) {
        return AppLocalStorage.getItem(key);
      } else {
        AppLocalStorage.setItem(key, v);
      }
    },
    companyid(v) {
      let key = "cid";
      if (v === undefined) {
        return AppLocalStorage.getItem(key);
      } else {
        AppLocalStorage.setItem(key, v);
      }
    },
    sharecardsysno(v) {
      let key = "shareno";
      if (v === undefined) {
        return AppLocalStorage.getItem(key);
      } else {
        AppLocalStorage.setItem(key, v);
      }
    },
    usersysno(v) {
      let key = "usersysno";
      if (v === undefined) {
        return AppLocalStorage.getItem(key);
      } else {
        AppLocalStorage.setItem(key, v);
      }
    },
    // picker地址选择
    areaList(v) {
      let key = "area";
      if (v === undefined) {
        return AppLocalStorage.getItem(key);
      } else {
        AppLocalStorage.setItem(key, v);
      }
    },
    customerDetails(v) {
      let key = "customerdetails";
      if (v === undefined) {
        return AppLocalStorage.getItem(key);
      } else {
        AppLocalStorage.setItem(key, v);
      }
    },
    // picker地址选择
    couponSysNo(v) {
      let key = "couponsysno";
      if (v === undefined) {
        return AppLocalStorage.getItem(key);
      } else {
        AppLocalStorage.setItem(key, v);
      }
    },
    // picker地址选择
    lotterySysNo(v) {
      let key = "lotterysysno";
      if (v === undefined) {
        return AppLocalStorage.getItem(key);
      } else {
        AppLocalStorage.setItem(key, v);
      }
    }
  }
};
export default AppLocalStorage;
